<template>
  <el-col :span="5" class="user-icon-box">
    <div class="icon-box">
      <span
        :class="['iconfont course-icon', leftInfos.iconTxt, leftInfos.classes]"
      ></span>
    </div>
    <div class="user-box">
      <p class="user-name">{{ leftInfos.name }}</p>
      <span class="user-time">{{ leftInfos.time | getTime }}</span>
      <span class="user-date">{{ leftInfos.time | getDate }}</span>
    </div>
  </el-col>
</template>
<script>
export default {
  props: {
    leftInfos: {
      type: Object,
      default: function () {
        return {};
      },
    },
  },
  filters: {
    getTime: function (val) {
      let tempStr = "";
      if (val) {
        tempStr = val.substring(val.indexOf(" "), val.lastIndexOf(":"));
      }
      return tempStr;
    },
    getDate: function (val) {
      let tempStr = "";
      if (val) {
        tempStr = val.substring(0, val.indexOf(" "));
      }
      return tempStr;
    },
  },
  data() {
    return {
      states: {
        1: {
          // 简历转签
          iconTxt: "&#xe6e6;",
          classes: "course-tran-sign",
        },
        2: {
          // 面试转签
          iconTxt: "&#xe6e6;",
          classes: "course-tran-sign",
        },
        3: {
          // 简历反馈
          iconTxt: "&#xe621;",
          classes: "course-info",
        },
        4: {
          // 面试安排
          iconTxt: "&#xe639;",
          classes: "course-arrage",
        },
        5: {
          // 面试反馈
          iconTxt: "&#xe621;",
          classes: "course-info",
        },
      },
    };
  },
  beforeMount() {
    /*  this.stus.iconTxt = this.states[this.leftInfos.state].iconTxt
        this.stus.classNames = this.states[this.leftInfos.state].classes */
  },
};
</script>
<style lang="scss">
@import "~@/assets/scss/bilibili-theme.scss";
.user-icon-box {
  //width: 150px;
  .user-box {
    min-width: 80px;
    float: left;
    height: auto;
    padding: 0 0 0 10px;
    max-width: 170px;
    span {
      display: block;
      text-align: left;
      width: 80px;
      line-height: 22px;
      font-size: 12px;
    }
    .user-name {
      font-family: "Microsoft YaHei";
      line-height: 24px;
      text-align: left;
      font-size: 12px;
      color: #636363;
    }
    .user-time,
    .user-date {
      font-size: 12px;
      color: #636363;
    }
    .user-date {
      color: #bcbcbc;
    }
  }
  @media (max-width: 1600px) {
    .user-box {
      width: 80px;
    }
  }
  .icon-box {
    float: left;
    margin-left: 10px;
    margin-top: 10px;
    .course-icon {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      color: #fff;
      display: inline-block;
      font-size: 20px;
      text-align: center;
      line-height: 48px;
      border: 3px solid $-bakcground-secondary;
    }
    .course-info {
      background-color: $main-color;
    }
    .course-arrage {
      background-color: $-bakcground-secondary;
    }
    .course-tran-sign {
      background-color: #ff525d;
    }
  }
}
</style>
